import { onMounted } from 'vue'
import moment from 'moment'
const globalMixIn = {
  data () {
    return {
      mixin: 'gloabal mixin' 
    }
  },
  methods: {
    // 全局格式化时间函数
    formatTime(time: string) {
      if (!time) {
        return '--'
      } else {
        return moment(time).format('YYYY-MM-DD hh:mm:ss').replace(/-/g,'.')
      }
    }
  },
  setup() {
    onMounted(() => {
      console.log('global mixin onmounted!');
    })
    return {}
  }
}

export default globalMixIn